package com.baselib.libnetwork.net.adapter;

import com.baselib.libnetwork.net.base.Callback;
import com.baselib.libnetwork.net.model.ResultResponse;
import com.baselib.libnetwork.net.request.CustomRequest;

/**
 * @author lixuce
 * @version v1.0
 * @description
 * @since 2017/10/29
 */

public interface Call<T> {

    /**
     * 同步执行
     */
    ResultResponse<T> execute() throws Exception;

    /**
     * 异步回调执行
     */
    void execute(Callback<T> callback);


    /**
     * 取消
     */
    void cancel();

    /**
     * 是否取消
     */
    boolean isCanceled();

    Call<T> clone();

    CustomRequest getRequest();
}
